package _Pan3D.program.shaders
{
	import _Pan3D.program.Shader3D;
	
	public class BaseShader extends Shader3D
	{
		public static var BASESHADER:String = "baseshader";
		public function BaseShader()
		{
			vertex = 
				"add vt2.x,va3.x,vc12.x\n" + //变量+默认偏移
				"frc vt2.x,vt2.x\n" + //求小数部分
				"mul vt1,va2,vt2.x \n" + //得出最终放大的比例
				"mul vt0.xyz,va0.xyz,vt1.w \n" + //放大的数值
				"add vt0.xyz,va0.xyz,vt0.xyz \n" + //最终数值
				
				"mov vt1.w,va0.w \n" +
				"m44 vt1, vt1, vc8 \n" + //移动距离
				
				"mov vt0.w,va0.w \n" +
				"m44 vt0, vt0, vc4 \n" + //基础变化值
				
				"add vt0.xyz,vt0.xyz,vt1.xyz \n" + //最终数值

				"m44 op, vt0, vc0 \n" + //输出
				"mov v1, va1 \n" + 
				"mov v2, va3 \n" + 
				"mov v2.x, vt2.x";
			fragment =
				"mov ft3.x,v2.x \n" + //t
				"neg ft3.y,v2.x \n" + //-t
				"add ft3.y,ft3.y,fc0.w \n" + //1-t
				"tex ft1, v1, fs0 <2d,clamp,repeat>\n"+
				"add ft1.a,ft1.a,fc0.x\n" + 
				"kil ft1.x\n" + //删除透明点
				"mul ft1,ft1,ft3.y\n" + 
				"mov ft2,fc1\n" + //目标色
				"mul ft2,ft2,ft3.x\n" + 
				"add ft1,ft1,ft2\n" + 
				"mov oc, ft1";
		}
	}
}
/*	
	"mov vt4,vc12 \n"+
	"m44 vt4, vt4, vc8 \n"+
	"m44 vt0, va0, vc4 \n" +
	
	"add vt0.x,vt0.x,vt4.x \n"+
	"add vt0.y,vt0.y,vt4.y \n"+
	"add vt0.z,vt0.z,vt4.z \n"+
	
	"m44 op, vt0, vc0 \n" +
	"mov v1, va1";
*/
/*
	"mul vt1,va2,vc12.x \n" +
	"mul vt0.xyz,va0.xyz,vt1.w \n" +
	"add vt0.xyz,va0.xyz,vt0.xyz \n" +
	"add vt0.xyz,vt0.xyz,vt1.xyz \n" +
	"mov vt0.w,va0.w \n" +
	
	"m44 vt0, vt0, vc4 \n" +
	"m44 op, vt0, vc0 \n" +
	"mov v1, va1";
*/
/*
	"m44 vt0, va0, vc4 \n" +
	
	"mul vt1,va2,vc12.x \n" +
	"add vt0.xyz,vt1.xyz,vt0.xyz \n" +
	
	"m44 op, vt0, vc0 \n" +
	"mov v1, va1"; 

*/
/*
	"tex ft1, v1, fs0 <2d,clamp,repeat>\n"+
	"add ft1.a,ft1.a,fc0.x\n" + 
	"kil ft1.x\n" + 
	"mul ft1,ft1,fc0.y\n" + 
	"mov ft2,fc1\n" + 
	"mul ft2,ft2,fc0.z\n" + 
	"add ft1,ft1,ft2\n" + 
	"mov oc, ft1";
*/